using System.BusinessObjects.Transactions;
using NHibernate;

namespace Blazing.BusinessObjects.Queries
{
    public class QrySearchMenuItems
    {
        public static IQuery Query(int menuId)
        {
            string nql = "select mi from MenuItem mi where mi.Menu = :menuId order by mi.Menu, mi.SortOrder";
            IQuery qry = UnitOfWork.CurrentSession.CreateQuery(nql);
            qry.SetInt32("menuId", menuId);

            qry.SetCacheable(true);
            return qry;
        }
    }
}
